package com.musemun.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.context.annotation.Bean;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author winner
 * @since 2020-04-27
 */
@Data
@ContentRowHeight(140)
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor

@ApiModel(value="Cropifo对象", description="")
public class Cropifo implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "文物编号")
    @TableField("crNo")
    @ExcelProperty("文物编号")
    @ColumnWidth(25)
//    @TableId(value = "crNo", type = IdType.ID_WORKER)
    @NotNull(message = "crNo不能为空")
    @Min(value = 0, message = "crNo不能为负数")
    private Long crNo;

    @ColumnWidth(25)
    @ApiModelProperty(value = "工号")
    @ExcelProperty("工号")
    @TableField("eNo")
    @NotNull(message = "eNo不能为空")
    private Integer eNo;

    @ColumnWidth(25)
    @ApiModelProperty(value = "操作类型")
    @ExcelProperty("操作类型")
    @TableField("opType")
    @NotNull(message = "opType不能为空")
    private String opType;

    @ColumnWidth(25)
    @ApiModelProperty(value = "操作时间")
    @ExcelProperty("操作时间")
    @TableField("opDate")
    @NotNull(message = "opDate不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" ,timezone = "GMT+8")//数据库导出页面时json格式化
    private Date opDate;


}
